<?php

namespace app\admin\model;

use think\Db;

class Question extends Common
{
    protected $table = 'question';

    public function pageData($where = '', $keyword = '')
    {
        $pagesize = 2;
        return Db::name($this->table)
            ->alias('a')
            ->field('a.q_id,a.q_title,a.user_id,a.create_time,a.click,a.focus,a.audit,b.user_name')
            ->where($where)
            ->join('user b','a.user_id=b.user_id')
            ->paginate($pagesize, false, [
                'query' => [
                    'keyword' => $keyword
                ]
            ]);

    }
}